import request from '@/config/axios'

export interface ProductRelationVO {
  id: number
  orderNumber: string
  productCode: string
  orderQuantity: number
  deliveryDate: Date
  dictDeliveryProjectType: number
  quotation: number
  taxIncludedPrice: number
  priceTaxTotal: number
  taxRate: number
  remark: string
  version: string
  orderChangePerson: string
  orderChangeDate: Date
  productName: string
  modelSpecification: string
  unit: string
  dictChangeType: number
  dictStatus: boolean
}

// 查询订单管理-营销管理-订单产品信息列表
export const getProductRelationPage = async (params) => {
  return await request.get({ url: `/order/product-relation/page`, params })
}

// 查询订单管理-营销管理-订单产品信息列表
export const getProductRelationPageAll = async (params) => {
  return await request.get({ url: `/order/marketing-order-info/page`, params })
}


// 查询订单管理-营销管理-订单产品信息详情
export const getProductRelation = async (id: number) => {
  return await request.get({ url: `/order/product-relation/get?id=` + id })
}

// 新增订单管理-营销管理-订单产品信息
export const createProductRelation = async (data) => {
  console.log(data)
  return await request.post({ url: `/order/product-relation/create`, data })
}

// 修改订单管理-营销管理-订单产品信息
export const updateProductRelation = async (data) => {
  return await request.put({ url: `/order/product-relation/update`, data })
}

// 查询产品信息详情
export const getProductRelationInfo = async (orderNumber) => {
  return await request.get({ url: `/order/product-relation/get?orderNumber=` + orderNumber })
}

// 删除订单管理-营销管理-订单产品信息
export const deleteProductRelation = async (id: number) => {
  return await request.delete({ url: `/order/product-relation/delete?id=` + id })
}
//获取产品信息

export const getProductsList = async (params) => {
  return await request.get({ url: `/inventory/data/list`, params })
}
// 导出订单管理-营销管理-订单产品信息 Excel
export const exportProductRelation = async (params) => {
  return await request.download({ url: `/order/product-relation/export-excel`, params })
}
// 查询订单信息详情
export const getDetailProductRelation = async (orderNumber) => {
  return await request.get({ url: `/order/product-relation/getDetail?orderNumber=` + orderNumber })
}
